<template>
   <div class="hcontent">
       <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll" ref="els">
						<a :class="['mui-control-item',item.id===0? 'mui-active' :'']"  data-wid="tab-top-subpage-1.html" v-for="item in title" :key="item.id" @tap="getimg(item.id)"  ><!--@click="color(item.id,$event)-->
							{{item.title}}
						</a>
					</div>
	   </div>
       <ul>
            <li v-for="item in imglist" :key="item.id">
                <router-link :to="'/home/imgdetails/'+item.id">
                    <img v-lazy="item.img_url">
                </router-link>
                <div class="content">
                    <h6>{{item.seo_title}}</h6>
                    <p>{{item.seo_description}}</p>
                </div>
            </li>
        </ul>
    </div> 
</template>
<script>
export default {
    data(){
        return{
            title:[],
            imglist:[]
        }
    },
    methods:{
            // 开始进入高亮
           /* color:function(id){
                if(id!=0){
                    this.$refs.els.firstChild.style.color="#000";
                }else{
                      this.$refs.els.firstChild.style.color="#007aff";
                }
            }
        ,*/
        async gettitle(){
    
             const {data}=await this.axios.get("/api/getimgcategory");
             if(data.status===0){
                data.message.unshift({
                    id:0,
                    title:"全部"
                })
                this.title=data.message;
             }
        },
         async getimg(id){
             const {data}=await this.axios.get("/api/getimages/"+id);
             if(data.status===0){
                
                this.imglist=data.message;
             }
        }
    },
    created(){
        this.getimg(0);
        this.gettitle();
    }

}
		
</script>

<style scoped>
.content{
    position: absolute;
    bottom: 0;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    max-height: 86px;
    overflow: hidden;
}
.content h6{
   font-size: 14px;
   color: #fff;
}
.content p{
  color: #fff;
  text-align: left;
    text-indent: 2em;
    font-size: 13px;
}
li{
    list-style: none;
}
/*
.mui-scroll a:first-child{
    color: #007aff;
}*/
img[lazy=loading] {
  width: 30px;
   height: 300px;
   margin: auto;
}
ul{
    margin: 10px auto;
    max-width: 600px;
}
li{

    background-color: #ccc;
    text-align: center;
    box-shadow: 0 0 7px grey;
    position: relative;

}
li img{
    width: 100%;
    vertical-align: middle;
}
ul li{
    margin-top: 10px;
}
ul li:first-child{
    margin-top: 0px;
}

.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{
   border-bottom:none;
}
.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			
			.mui-pull-top-tips {
				position: absolute;
				top: -20px;
				left: 50%;
				margin-left: -25px;
				width: 40px;
				height: 40px;
				border-radius: 100%;
				z-index: 1;
			}
			
			.mui-bar~.mui-pull-top-tips {
				top: 24px;
			}
			
			.mui-pull-top-wrapper {
				width: 42px;
				height: 42px;
				display: block;
				text-align: center;
				background-color: #efeff4;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				box-shadow: 0 4px 10px #bbb;
				overflow: hidden;
			}
			
			.mui-pull-top-tips.mui-transitioning {
				-webkit-transition-duration: 200ms;
				transition-duration: 200ms;
			}
			
			.mui-pull-top-tips .mui-pull-loading {
				/*-webkit-backface-visibility: hidden;
				-webkit-transition-duration: 400ms;
				transition-duration: 400ms;*/
				margin: 0;
			}
			
			.mui-pull-top-wrapper .mui-icon,
			.mui-pull-top-wrapper .mui-spinner {
				margin-top: 7px;
			}
			.mui-pull-top-wrapper .mui-icon.mui-reverse {
				/*-webkit-transform: rotate(180deg) translateZ(0);*/
			}
			
			.mui-pull-bottom-tips {
				text-align: center;
				background-color: #efeff4;
				font-size: 15px;
				line-height: 40px;
				color: #777;
			}
			
			.mui-pull-top-canvas {
				overflow: hidden;
				background-color: #fafafa;
				border-radius: 40px;
				box-shadow: 0 4px 10px #bbb;
				width: 40px;
				height: 40px;
				margin: 0 auto;
			}
			
			.mui-pull-top-canvas canvas {
				width: 40px;
			}
			
			.mui-slider-indicator.mui-segmented-control {
				background-color: #efeff4;
			}
</style>